
   <html>
   <head>
   <style type=text/css>
   body { font-size: 10pt; font-family: Arial; }
   table { width: 70%;font-size: 10pt; font-family: Arial; 
           overflow: auto; border-spacing:0;border-collapse:collapse}
   td { font-size: 10pt; font-family: Arial; border: solid 1px black;}
   td.t { font-size: 10pt; font-family: Arial; border: solid 1px black; 
          background: lightgrey; }
   A:link {text-decoration: none; color: darkblue}
   A:visited {text-decoration: none; color: darkblue}
   A:active {text-decoration: none; color: darkblue}
   A:hover {text-decoration: none; color: darkgray;}
   </style>
   </head>
   <body>
   
<h1>&lt;coelacanth/string.h&gt;</h1>
Sample File: <a href='string.c.html'>string.c</a><br><br>
<table><tr><td class="t" colspan="2"><b> string(s)</b></td></tr>
<tr><td colspan="2"><i> Create a string variable</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  varname</td><td> variable name</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_ptr(s)</b></td></tr>
<tr><td colspan="2"><i> Create a string pointer</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  varname</td><td> variable name</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_free(s)</b></td></tr>
<tr><td colspan="2"><i> Free memory allocated by string_*() functions</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *varname</td><td> memory allocated string</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_assign_str(s, v)</b></td></tr>
<tr><td colspan="2"><i> Assign c-string value to s</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *varname</td><td> memory allocated string or null pointer</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>const</font> char *str</td><td> value to assign</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_assign_int(s, v)</b></td></tr>
<tr><td colspan="2"><i> Assign <font color='darkgreen'>int</font> value to s</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *s</td><td> memory allocated string or null pointer</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>int</font> v</td><td> value</td></tr>
<tr><td><font color="#6d4d00">return</font> char*</td><td> pointer to s</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_assign_float(s, v)</b></td></tr>
<tr><td colspan="2"><i> Assign <font color='darkgreen'>float</font> value to s</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *s</td><td> memory allocated string or null pointer</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>float</font> v</td><td> value</td></tr>
<tr><td><font color="#6d4d00">return</font> <font color='darkgreen'>char</font> *</td><td> pointer to s</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_to_int(varname)</b></td></tr>
<tr><td colspan="2"><i> Cast string to int</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  varname</td><td> string</td></tr>
<tr><td><font color="#6d4d00">return</font> int</td><td> <font color='darkgreen'>int</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_to_float(s)</b></td></tr>
<tr><td colspan="2"><i> Cast string to <font color='darkgreen'>float</font> </i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *s</td><td> string</td></tr>
<tr><td><font color="#6d4d00">return</font> float</td><td> <font color='darkgreen'>float</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_append(varname, str)</b></td></tr>
<tr><td colspan="2"><i> Append c-string value to varname</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *varname</td><td> memory allocated string or null pointer</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  str</td><td> value</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_replace(s, pattern, replacement)</b></td></tr>
<tr><td colspan="2"><i> Replace pattern by replacement.</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *varname</td><td> memory allocated string </td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>const</font> char *pattern</td><td> pattern</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>const</font> char *replacement</td><td> replacement</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_trim(varname)</b></td></tr>
<tr><td colspan="2"><i> Remove whitespace from the start and end of the string</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *varname</td><td> memory allocated string </td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_lpad(varname, padd_char, total_len)</b></td></tr>
<tr><td colspan="2"><i> Pads the left side of a string with a specific character</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *varname</td><td> memory allocated string </td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> padd_char</td><td> padding character</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>size_t</font> total_len</td><td> new string length</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_rpad(varname, padd_char, total_len)</b></td></tr>
<tr><td colspan="2"><i> Pads the right side of a string with a specific character</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *varname</td><td> memory allocated string </td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> padd_char</td><td> padding character</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>size_t</font> total_len</td><td> new string length</td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> no <font color="#6d4d00">return</font> value</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_cut(s, slen, begin, end)</b></td></tr>
<tr><td colspan="2"><i> Get a substring</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *s</td><td> memory allocated string </td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>size_t</font> slen</td><td> string buffer size</td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>size_t</font> begin</td><td> begin index </td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>size_t</font> end</td><td> end index </td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> pointer to s</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_find(s, pattern)</b></td></tr>
<tr><td colspan="2"><i> Find next occurrence of pattern</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *s</td><td> memory allocated string </td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>const</font> char *pattern</td><td> pattern</td></tr>
<tr><td><font color="#6d4d00">return</font> size_t</td><td> pattern position, -1 if not found</td></tr></table><br>
<table><tr><td class="t" colspan="2"><b> string_split(s, token)</b></td></tr>
<tr><td colspan="2"><i> Split strings using token as a separator</i></td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>char</font> *s</td><td> memory allocated string </td></tr>
<tr><td width="30%"><font color="#27406d">param</font>  <font color='darkgreen'>const</font> char *token</td><td> separator </td></tr>
<tr><td><font color="#6d4d00">return</font></td><td> pointer s</td></tr></table><br>
</body></html>
